import { createApp } from 'vue'

import App from './App.vue'

// 加入路由
import router from './router/index'

// 导入ElementPlus组件
import ElementPlus from 'element-plus'

//引用ElementPlus样式
import 'element-plus/dist/index.css'

// 引入图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// 引入 pina
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

//导入插件
import myPlugin from '@/plugin/index'

const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)

const app = createApp(App)
app.use(router)

app.use(pinia)

app.use(ElementPlus)
app.use(myPlugin)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }
  
app.mount('#app1')
